package com.bangyu.monitor.modular.api;

import com.bangyu.monitor.core.schedule.ExportData;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zhangxue
 * @Date: 19/8/4 22:43
 * @Description:
 */
@Controller
@RequestMapping("/export")
public class ExportController {

    @Autowired
    private ExportData exportData;

    @RequestMapping("")
    @ResponseBody
    public String export(@RequestParam(value = "devices",required = false) String devices){
        if(StringUtils.isNotBlank(devices)){
            exportData.task(devices);
        }
        return "success";
    }
}
